package com.hyundaihds.hdscontacts;

import android.app.*;
import android.content.*;
import android.database.*;
import android.database.sqlite.*;
import android.os.*;
import android.text.*;
import android.view.*;
import android.widget.*;
import android.widget.AdapterView.*;

public class Menu3 extends Activity implements OnItemClickListener {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.menu3);

		ArrayAdapter<CharSequence> Adapter;
		Adapter = ArrayAdapter.createFromResource(this, R.array.floor,
				android.R.layout.simple_list_item_1);

		ListView list = (ListView) findViewById(R.id.foor_list);

		// ListView 클릭 이벤트 달아주기
		list.setOnItemClickListener(this);

		list.setAdapter(Adapter);
	}

	public void onItemClick(AdapterView<?> arg0, View arg1, int position,
			long arg3) {
		// TODO Auto-generated method stub

	
		int floor;
		try {
			floor = Integer.parseInt(arg0.getItemAtPosition(position).toString().replace("층", ""));
			Intent intent = new Intent(Menu3.this, SeatView.class);
			
			intent.putExtra("floor", floor);	//층 정보
			intent.putExtra("sector", 0);		//구역 정보
			
			startActivity(intent);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	

	}

}